import instance from '@/utils/request.js'

// 获取tag
export function getTagApi () {
  return instance({
    url: '/v1_0/channels'
  })
}

// 获取推荐文章列表
export function getArticlesApi (params) {
  return instance({
    url: '/v1_1/articles',
    params: params,
    needToken: true
  })
}

// 获取文章列表
// eslint-disable-next-line camelcase
export function getArtApi ({ id, page, per_page }) {
  return instance({
    url: `/v1_0/users/${id}/articles`,
    params: {
      page: page,
      per_page: per_page
    },
    needToken: true
  })
}

// 获取用户频道列表
export function getUserTagApi () {
  return instance({
    url: '/v1_0/user/channels',
    needToken: true
  })
}

// 修改用户频道列表
export function putUserTagApi (data) {
  return instance({
    url: '/v1_0/user/channels',
    method: 'PUT',
    data: data,
    needToken: true
  })
}

// 对文章不喜欢
export function noLikeArticleApi (data) {
  return instance({
    url: '/v1_0/article/dislikes',
    method: 'post',
    data: data,
    needToken: true
  })
}

// 拉黑用户
export function blockUserApi (data) {
  return instance({
    url: '/v1_0/user/blacklists',
    method: 'post',
    data: data,
    needToken: true
  })
}

// 举报文章
export function reportArticleApi (data) {
  return instance({
    url: '/v1_0/article/reports',
    method: 'post',
    data: data,
    needToken: true
  })
}
